<!DOCTYPE html>
<html>
<head>
    <!--[if lt IE 7]>
    <div class="ie6_error">还在用<strong>漏洞百出的IE6浏览器</strong>么？为了您的网络安全，请升级浏览器 <a target="_blank"
                                                                               href="http://browsehappy.com">立即升级</a>
    </div>
    <![endif]-->

    <meta charset="utf-8">
    <title>个人中心-企业发票-文具1号</title>
    <meta name="description"
          content="文具1号作为上海办公用品供货商公司,专为世界500强企业及SOHO办公族提供网上商城一站式办公耗材批发及采购服务,一站式选购办公日用文具用品,厂家直销,好货又便宜【阳光采购就上文具1号 阳光价格 老板放心 品质保障 员工省力】"/>
    <meta name="keywords" content="办公用品,办公文具,办公文具网站,文具网站,办公用品网,文具采购网,金万年"/>
    <meta name="copyright" content="上海易推信息科技有限公司"/>
    <base href="<?php echo base_url(); ?>"/>
    <meta name="renderer" content="webkit">
    <link rel="shortcut icon" href="favicon.ico"/>
    <link rel="stylesheet" href="public/js/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="public/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/cost-center.css"/>

    <!--[if lte IE 9]>
    <script type="text/javascript" src="public/js/html5shiv-printshiv-3.js"></script>
    <![endif]-->
</head>
<body>
<div class="bg">
    <!--common - head -->
    <?php $this->load->view('common/header.php'); ?>
    <!--common - head end-->

    <div class="container mt30">
        <div class="my-center-container">
            <?php $this->load->view('member/personal_left.php'); ?>
            <div class="my-center-right" style="overflow:visible;">
                <p class="my-center-right-tit">企业发票</p>
                <div class="my-center-right-cont" style="padding: 0;">
                    <div class="corporate-invoice-search-box">

                        <form class="layui-form corporate-invoice-search-from"
                              action="<?php echo base_url('member/business_invoice'); ?>" method="post">
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">发票代码-编号：</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="invoice_bn" name="price_min" placeholder="请输入发票代码-编号"
                                               autocomplete="off"
                                               class="layui-input"<?php if (isset($invoice_bn)): ?>  value="<?php echo $invoice_bn ?>" <?php endif; ?>>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">开票时间：</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="stratdate" id="date-star" lay-verify="date"
                                               placeholder="" autocomplete="off"
                                               class="layui-input layui-input-time" <?php if (isset($created_at1)): ?>  value="<?php echo $created_at1 ?>" <?php endif; ?> >
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">至</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="enddate" id="date-end" lay-verify="date" placeholder=""
                                               autocomplete="off"
                                               class="layui-input layui-input-time" <?php if (isset($created_at2)): ?>  value="<?php echo $created_at2 ?>" <?php endif; ?> >
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">发票类型：</label>
                                    <div class="layui-input-inline layui-input-inline-time">
                                        <select name="modules" id="invoice_type" lay-verify="required" lay-search="">
                                            <?php if (isset($invoice_type) && $invoice_type == 1): ?>
                                                <option value="" class="invoice_type">增值税专用发票</option>
                                            <?php elseif (isset($invoice_type) && $invoice_type == 2): ?>
                                                <option value="" class="invoice_type">增值税普通发票</option>
                                            <?php endif; ?>
                                            <option value="">全部</option>
                                            <option value="1">增值税专用发票</option>
                                            <option value="2">增值税普通发票</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <button class="layui-btn" id="sub" lay-filter="demo1" type="submit">查询</button>
                                    <button type="reset" class="layui-btn layui-btn-primary" id="delete">重置</button>
                                </div>
                            </div>
                        </form>

                    </div>
                    <div class="corporate-invoice-table-box">
                        <table border="1" class="corporate-invoice-tab">
                            <thead>
                            <tr>
                                <th>发票代码-编号</th>
                                <th width="220">发票抬头</th>
                                <th width="165">开票时间</th>
                                <th>金额（元）</th>
                                <th>订单金额</th>
                                <th>发票类型</th>
                                <th width="150">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if (isset($invoice)): ?>
                                <?php foreach ($invoice as $ket => $inv): ?>
                                    <?php if (isset($inv['id'])): ?>
                                        <tr>

                                            <!--                                        <td>-->
                                            <?php //print_r($inv['cata']) ?><!--</td>-->

                                            <td><?php echo $inv['invoice_bn'] ?></td>
                                            <td class="td01"><?php echo $inv['invoice_title'] ?></td>
                                            <td><?php echo $inv['created_at'] ?> </td>
                                            <td>￥<?php echo $inv['invoice_money'] ?> </td>
                                            <?php if (isset($inv['money'])): ?>
                                                <td><?php echo array_sum($inv['money']) ?> </td>
                                            <?php else: ?>
                                                <td>0</td>
                                            <?php endif; ?>
                                            <?php if ($inv['invoice_type'] == 1): ?>
                                                <td>增值税专用发票</td>
                                            <?php endif; ?>
                                            <?php if ($inv['invoice_type'] == 2): ?>
                                                <td>增值税普通发票</td>
                                            <?php endif; ?>
                                            <td class="td02 " style="overflow:visible">
                                                <a href="javascript:;" class="deal-detail icon-more">订单详情</a>
                                                <a href="javascript:;" class="invoice-detail"
                                                   data-url="<?php echo $inv['invoice_pic'] ?>">查看详情</a>

                                                <div class="show-more bg-bg_pop2 none">
                                                    <?php if (isset($inv['cata'])): ?>
                                                        <div class="show-more-cont">
                                                            <?php foreach ($inv['cata'] as $key => $ord): ?>
                                                                <p>
                                                                <span class="text-ellipsis span01">订单号：<a
                                                                            style="color:blue;"
                                                                            href="<?php echo base_url(); ?>order/common?id=<?php echo $ord['order_id']; ?>"><?php echo $ord['order_bn'] ?><?php echo $ord['money'] ?></a></span>
                                                                    <span class="span02">金额：<?php echo $ord['money'] ?>
                                                                        元</span>
                                                                </p>
                                                            <?php endforeach; ?>
                                                        </div>
                                                    <?php else: ?>
                                                        <p>
                                                            无订单
                                                        </p>
                                                    <?php endif; ?>
                                                </div>

                                            </td>

                                        </tr>
                                    <?php endif; ?>
                                <?php endforeach; ?>
                            <?php endif; ?>
                            </tbody>
                        </table>
                        <!--<table class="layui-hide" id="test"></table>-->
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<div class="mask none"></div>
<div class="pop corporate-invoice-img-pop none">
    <a href="javascript:;" class="close"></a>
    <img class="corporate-invoice-img" src="" alt="">
</div>
<script type="text/javascript" src="public/js/jquery.min.js"></script>
<script src="public/js/layui/layui.js"></script>
<script type="text/javascript" src="public/js/index.js"></script>
<script type="text/javascript" src="public/js/owl.carousel.min.js"></script>

<script>
    layui.use(['element', 'form', 'layedit', 'laydate', 'upload'], function () {
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;
        var $ = layui.jquery
            , upload = layui.upload;

        //监听导航点击
        element.on('nav(demo)', function (elem) {
            //console.log(elem)
//      layer.msg(elem.text());
        });
        //日期
        laydate.render({
            elem: '#date-star'
        });
        laydate.render({
            elem: '#date-end'
        });
        //监听提交
        form.on('submit(demo1)', function (data) {
            return false;
        });


    });
</script>
<script type="text/javascript">
    $(function () {
        $("body").on('click', '.deal-detail', function () {
            $(this).parent().find(".show-more").toggle();
            $(this).parent().find(".show-more").css('z-index', 9999999999)
        });
        $("body").on('click', '.invoice-detail', function () {
            var url = $(this).attr('data-url');
            if (url) {
                $('.corporate-invoice-img').attr("src", url);
                $('.mask,.corporate-invoice-img-pop').show();
            } else {
                layer.msg('暂无发票详情')
            }
        });
//
        $("body").on('mouseleave', '.show-more', function () {
            $(this).parent().find(".show-more").hide();
        });
        $('#delete').click(function () {
            $("input").attr("value", "");
            $(".invoice_type").empty();
        });
    });

</script>
</body>
</html>